home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / dev / cross / sasmv14.dms / sasmv14.adf / examples / longstrings.s < prev    next >
Text File  |  1993-05-22  |  25KB  |  449 lines

  1.  
  2. *****************************************************
  3. **
  4. **
  5. **  This is just a part from the orginal SASM 68030 
  6. **  sourcecode.
  7. **
  8. **  Just to checkout, how define constant works...
  9. **
  10. **  © 1993 by Florian W. Sauer
  11. **
  12. *****************************************************
  13.  
  14.     HEAP    O=16k
  15.  
  16. ;---------------------------------------------------------------------------------
  17. ;Hash Fields and some goodie stuff
  18. ;© 1992 by Stefan Schulze of Infernal Byte Systems, INC.
  19. ;---------------------------------------------------------------------------------
  20. MaxCom        EQU    102            ;max # of commands
  21. NumAdrModes    EQU    24            ;number of adr modes
  22. MaxHash        EQU    25+(25*14)+(25*20)    ;(875)
  23. HashSize    EQU    MaxHash*NumAdrModes
  24.  
  25. ImpAdrModeSize    EQU    MaxHash*2        ;conv hash# to adrmode
  26.  
  27. ModeToAdrMode:
  28.     dc.b    0,0,0,0,6,0,0,0,14,0,0,0,17,0,0,0    ;for adrmode scanner
  29.     dc.b    0,0,0,0,7,0,0,0,15,0,0,0,18,0,0,0
  30.     dc.b    0,0,0,0,8,0,0,0,16,0,0,0,0,0,0,0
  31.     dc.b    0,0,0,0,0,9,0,0,0,21,0,0,0,0,0,0
  32.     dc.b    0,0,0,0,0,10,0,0,0,22,0,0,0,0,0,0
  33.     dc.b    0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0
  34.     dc.b    0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0
  35.     dc.b    0,0,0,0,0,0,13,0,0,0,0,0,0,0,0,0
  36.     dc.b    0,0,0,0,19,0,0,0,0,0,0,0,0,0,0,0
  37.     dc.b    0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0
  38.     dc.b    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  39.     dc.b    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  40.     dc.b    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  41.     dc.b    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  42.     dc.b    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  43.     dc.b    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  44.  
  45. IsCmdByteImmX:
  46.     dc.l    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0        ;LDX,LDY,CPX,CPY
  47.     dc.l    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  48.     dc.w    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0        ;two because, simply adding
  49.     dc.b    2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0        ;will work...
  50.     dc.b    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  51.     dc.b    2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  52.     dc.b    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  53.     dc.b    2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  54.     dc.b    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  55.  
  56. Memo:    dc.b 'ADC',0,'AND',0,'ASL',0,'BCC',0,'BLT',0,'BCS',0,'BGE',0,'BEQ',0,'BIT',0,'BMI',0,'BPL',0
  57.     dc.b 'BRA',0,'BRK',0,'BRL',0,'BVC',0,'BVS',0,'CLC',0,'CLD',0,'CLI',0,'CLV',0,'CMP',0,'COP',0
  58.     dc.b 'CPX',0,'CPY',0,'DEC',0,'DEX',0,'DEY',0,'EOR',0,'INC',0,'INX',0,'INY',0,'JML',0,'JMP',0
  59.     dc.b 'JSL',0,'JSR',0,'LDA',0,'LDX',0,'LDY',0,'LSR',0,'MVN',0,'MVP',0,'NOP',0,'ORA',0,'PEA',0
  60.     dc.b 'PEI',0,'PER',0,'PHA',0,'PHB',0,'PHD',0,'PHK',0,'PHP',0,'PHX',0,'PHY',0,'PLA',0,'PLB',0
  61.     dc.b 'PLD',0,'PLP',0,'PLX',0,'PLY',0,'REP',0,'ROL',0,'ROR',0,'RTI',0,'RTL',0,'RTS',0,'SBC',0
  62.     dc.b 'SEC',0,'SED',0,'SEI',0,'SEP',0,'STA',0,'STP',0,'STX',0,'STY',0,'STZ',0,'TAX',0,'TAY',0
  63.     dc.b 'TCD',0,'TCS',0,'TDC',0,'TRB',0,'TSB',0,'TSC',0,'TSX',0,'TXA',0,'TXS',0,'TXY',0,'TYA',0
  64.     dc.b 'TYX',0,'WAI',0,'WDM',0,'XBA',0,'XCE',0,'BNE',0,'CMA',0,'DEA',0,'INA',0,'TAD',0,'TAS',0
  65.     dc.b 'TDA',0,'TSA',0,'SWA',0
  66.  
  67. Hash:    dc.w    082,242,472,069,535,389,165,377,493,329,431
  68.     dc.w    239,439,459,335,655,196,216,316,576,470,498
  69.     dc.w    672,692,099,519,539,540,230,650,670,397,477
  70.     dc.w    481,601,053,513,533,603,566,606,509,252,071
  71.     dc.w    231,411,113,133,173,313,413,573,593,169,189
  72.     dc.w    229,469,629,649,373,433,553,443,503,643,072
  73.     dc.w    114,134,234,374,284,584,744,764,784,479,499
  74.     dc.w    107,407,101,277,291,311,731,341,701,821,355
  75.     dc.w    815,182,304,037,131,263,170,059,190,079,379
  76.     dc.w    061,271,326,-1
  77.  
  78. *  ADRESSING MODE LIST LEGEND:
  79. *  ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  80. * 0)   #     = IMMEDIATE
  81. * 1)   A     = ACCUMULATOR
  82. * 2)   r     = PC RELATIVE
  83. * 3)   rl     = PC RELATIVE LONG
  84. * 4)   i    = IMPLIED
  85. * 5)   s    = STACK
  86. * 6)   d    = DIRECT
  87. * 7)   d,x     = DIRECT INDEXED WITH X
  88. * 8)   d,y     = DIRECT INDEXED WITH Y
  89. * 9)   (d)    = DIRECT INDIRECT
  90. * 10)  (d,x)     = DIRECT INDEXED INDIRECT
  91. * 11)  (d),y    = DIRECT INDIRECT INDEXED
  92. * 12)  [d]    = DIRECT INDIRECT LONG
  93. * 13)  [d],y    = DIRECT INDIRECT LONG INDEXED
  94. * 14)  a    = ABSOLUTE
  95. * 15)  a,x    = ABSOLUTE INDEXED WITH X
  96. * 16)  a,y    = ABSOLUTE INDEXED WITH Y
  97. * 17)  al    = ABSOLUTE LONG
  98. * 18)  al,x    = ABSOLUTE LONG INDEXED (WITH X)
  99. * 19)  d,s    = STACK RELATIVE
  100. * 20)  (d,s),y  = STACK RELATIVE INDIRECT INDEXED
  101. * 21)  (a)    = ABSOLUTE INDIRECT
  102. * 22)  (a,x)    = ABSOLUTE INDEXED INDIRECT
  103. * 23)  xyc    = BLOCK MOVE
  104. *
  105. * 24)  #     = IMMEDIATE only 8 bit for BRK,COP,REP,SEP in analyzing only
  106. *  
  107. * #;A;r;rl;i;s;d;d,x;d,y;(d);(d,x);(d),y;[d];[d],y;a;a,x;a,y;al;al,x;d,s;(d,s),y;(a);(a,x);xyc
  108.  
  109. MemoBytes:
  110.  dc.b $69,0,0,0,0,0,$65,$75,0,$72,$61,$71,$67,$77,$6d,$7d,$79,$6f,$7f,$63,$73,0,0,0 ;ADC 1 15
  111.  dc.b $29,0,0,0,0,0,$25,$35,0,$32,$21,$31,$27,$37,$2d,$3d,$39,$2f,$3f,$23,$33,0,0,0 ;AND 2 15
  112.  dc.b 0,$0a,0,0,0,0,$06,$16,0,0,0,0,0,0,$0e,$1e,0,0,0,0,0,0,0,0                ;ASL 3 5
  113.  dc.b 0,0,$90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;BCC 4 1
  114.  dc.b 0,0,$90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;BLT=BCC 5 1
  115.  dc.b 0,0,$B0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;BCS 6 1
  116.  dc.b 0,0,$B0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;BGE=BCS 7 1
  117.  dc.b 0,0,$F0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;BEQ 8 1
  118.  dc.b $89,0,0,0,0,0,$24,$34,0,0,0,0,0,0,$2c,$3c,0,0,0,0,0,0,0,0                ;BIT 9 5
  119.  dc.b 0,0,$30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;BMI 10 1
  120.  dc.b 0,0,$10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;BPL 11 1
  121.  dc.b 0,0,$80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;BRA 12 1
  122.  dc.b 0,0,0,0,0,$00,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;BRK 13 1
  123.  dc.b 0,0,0,$82,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;BRL 14 1
  124.  dc.b 0,0,$50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;BVC 15 1
  125.  dc.b 0,0,$70,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;BVS 16 1
  126.  dc.b 0,0,0,0,$18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;CLC 17 1
  127.  dc.b 0,0,0,0,$d8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;CLD 18 1
  128.  dc.b 0,0,0,0,$58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;CLI 19 1
  129.  dc.b 0,0,0,0,$b8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;CLV 20 1
  130.  dc.b $c9,0,0,0,0,0,$c5,$d5,0,$d2,$c1,$d1,$c7,$d7,$cd,$dd,$d9,$cf,$df,$c3,$d3,0,0,0 ;CMP 21 15
  131.  dc.b 0,0,0,0,0,$02,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;COP 22 1
  132.  dc.b $e0,0,0,0,0,0,$e4,0,0,0,0,0,0,0,$ec,0,0,0,0,0,0,0,0,0                ;CPX 23 3
  133.  dc.b $c0,0,0,0,0,0,$e4,0,0,0,0,0,0,0,$cc,0,0,0,0,0,0,0,0,0                ;CPY 24 3
  134.  dc.b 0,$3a,0,0,0,0,$c6,$d6,0,0,0,0,0,0,$ce,$de,0,0,0,0,0,0,0,0                ;DEC 25 5
  135.  dc.b 0,0,0,0,$CA,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;DEX 26 1
  136.  dc.b 0,0,0,0,$88,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;DEY 27 1
  137.  dc.b $49,0,0,0,0,0,$45,$55,0,$52,$41,$51,$47,$57,$4d,$5d,$59,$4f,$5f,$43,$53,0,0,0 ;EOR 28 15
  138.  dc.b 0,$1A,0,0,0,0,$E6,$F6,0,0,0,0,0,0,$EE,$FE,0,0,0,0,0,0,0,0                ;INC 29 5
  139.  dc.b 0,0,0,0,$E8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;INX 30 1
  140.  dc.b 0,0,0,0,$c8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;INY 31 1
  141.  dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,$5c,0,0,0,$dc,0,0                ;JML 32 2
  142.  dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,$4c,0,0,0,0,0,0,$6c,$7c,0                ;JMP 33 3
  143.  dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,$22,0,0,0,0,0,0                    ;JSL 34 1
  144.  dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,$20,0,0,0,0,0,0,0,$fc,0                ;JSR 35 2
  145.  dc.b $a9,0,0,0,0,0,$a5,$b5,0,$b2,$a1,$b1,$a7,$b7,$ad,$bd,$b9,$af,$bf,$a3,$b3,0,0,0 ;LDA 36 5
  146.  dc.b $a2,0,0,0,0,0,$a6,0,$b6,0,0,0,0,0,$ae,0,$be,0,0,0,0,0,0,0                ;LDX 37 5
  147.  dc.b $a0,0,0,0,0,0,$a4,$b4,0,0,0,0,0,0,$ac,$bc,0,0,0,0,0,0,0,0                ;LDY 38 5
  148.  dc.b 0,$4a,0,0,0,0,$46,$56,0,0,0,0,0,0,$4e,$5E,0,0,0,0,0,0,0,0                ;LSR 39 5
  149.  dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,$54                    ;MVN 40 1
  150.  dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,$44                    ;MVP 41 1
  151.  dc.b 0,0,0,0,$EA,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;NOP 42 1
  152.  dc.b $09,0,0,0,0,0,$05,$15,0,$12,$01,$11,$07,$17,$0D,$1D,$19,$0F,$1f,$03,$13,0,0,0 ;ORA 43 15
  153.  dc.b 0,0,0,0,0,$f4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;PEA 44 1
  154.  dc.b 0,0,0,0,0,$d4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;PEI 45 1
  155.  dc.b 0,0,0,0,0,$62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;PER 46 1
  156.  dc.b 0,0,0,0,0,$48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;PHA 47 1
  157.  dc.b 0,0,0,0,0,$8b,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;PHB 48 1
  158.  dc.b 0,0,0,0,0,$0b,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;PHD 49 1
  159.  dc.b 0,0,0,0,0,$4b,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;PHK 50 1
  160.  dc.b 0,0,0,0,0,$08,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;PHP 51 1
  161.  dc.b 0,0,0,0,0,$da,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;PHX 52 1
  162.  dc.b 0,0,0,0,0,$5a,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;PHY 53 1
  163.  dc.b 0,0,0,0,0,$68,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;PLA 54 1
  164.  dc.b 0,0,0,0,0,$ab,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;PLB 55 1
  165.  dc.b 0,0,0,0,0,$2b,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;PLD 56 1
  166.  dc.b 0,0,0,0,0,$28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;PLP 57 1
  167.  dc.b 0,0,0,0,0,$fa,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;PLX 58 1
  168.  dc.b 0,0,0,0,0,$7a,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;PLY 59 1
  169.  dc.b $C2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;REP 60 1
  170.  dc.b 0,$2A,0,0,0,0,$26,$36,0,0,0,0,0,0,$2e,$3E,0,0,0,0,0,0,0,0                ;ROL 61 5
  171.  dc.b 0,$6A,0,0,0,0,$66,$76,0,0,0,0,0,0,$6e,$7E,0,0,0,0,0,0,0,0                ;ROR 62 5
  172.  dc.b 0,0,0,0,0,$40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;RTI 63 1
  173.  dc.b 0,0,0,0,0,$6b,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;RTL 64 1
  174.  dc.b 0,0,0,0,0,$60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;RTS 65 1
  175.  dc.b $e9,0,0,0,0,0,$e5,$f5,0,$f2,$e1,$f1,$e7,$f7,$ed,$fd,$f9,$ef,$ff,$e3,$F3,0,0,0 ;SBC 66 15
  176.  dc.b 0,0,0,0,$38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;SEC 67 1
  177.  dc.b 0,0,0,0,$f8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;SED 68 1
  178.  dc.b 0,0,0,0,$78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;SEI 69 1
  179.  dc.b $e2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;SEP 70 1
  180.  dc.b 0,0,0,0,0,0,$85,$95,0,$92,$81,$91,$87,$97,$8d,$9d,$99,$8f,$9f,$83,$93,0,0,0   ;STA 71 14
  181.  dc.b 0,0,0,0,$db,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;STP 72 1
  182.  dc.b 0,0,0,0,0,0,$86,0,$96,0,0,0,0,0,$8E,0,0,0,0,0,0,0,0,0                ;STX 73 3
  183.  dc.b 0,0,0,0,0,0,$84,$94,0,0,0,0,0,0,$8C,0,0,0,0,0,0,0,0,0                ;STY 74 3
  184.  dc.b 0,0,0,0,0,0,$64,$74,0,0,0,0,0,0,$9C,$9e,0,0,0,0,0,0,0,0                ;STZ 75 3
  185.  dc.b 0,0,0,0,$aa,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;TAX 76 1
  186.  dc.b 0,0,0,0,$a8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;TAY 77 1
  187.  dc.b 0,0,0,0,$5b,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;TCD 78 1
  188.  dc.b 0,0,0,0,$ab,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;TCS 79 1
  189.  dc.b 0,0,0,0,$7b,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;TDC 80 1
  190.  dc.b 0,0,0,0,0,0,$14,0,0,0,0,0,0,0,$1c,0,0,0,0,0,0,0,0,0                ;TRB 81 2
  191.  dc.b 0,0,0,0,0,0,$04,0,0,0,0,0,0,0,$0c,0,0,0,0,0,0,0,0,0                ;TSB 82 2
  192.  dc.b 0,0,0,0,$3b,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;TSC 83 1
  193.  dc.b 0,0,0,0,$ba,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;TSX 84 1
  194.  dc.b 0,0,0,0,$8a,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;TXA 85 1
  195.  dc.b 0,0,0,0,$9a,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;TXS 86 1
  196.  dc.b 0,0,0,0,$9b,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;TXY 87 1
  197.  dc.b 0,0,0,0,$98,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;TYA 88 1
  198.  dc.b 0,0,0,0,$bb,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;TYX 89 1
  199.  dc.b 0,0,0,0,$cb,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;WAI 90 1
  200.  dc.b 0,0,0,0,$42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;WDM 91 1
  201.  dc.b 0,0,0,0,$eb,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;XBA 92 1
  202.  dc.b 0,0,0,0,$fb,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;XCE 93 1
  203.  dc.b 0,0,$d0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;BNE 94 1
  204.  
  205. ;alternative memonics, who knows where CMA comes from ??
  206.  
  207.  dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;CMA=CMP A 95 1
  208.  dc.b 0,0,0,0,$3a,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;DEA=DEC A 96 1
  209.  dc.b 0,0,0,0,$1a,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;INA=INC A 97 1
  210.  dc.b 0,0,0,0,$5b,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;TAD=TCD 98 1
  211.  dc.b 0,0,0,0,$ab,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;TAS=TCS 99 1
  212.  dc.b 0,0,0,0,$7b,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;TDA=TDC 100 1
  213.  dc.b 0,0,0,0,$3b,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;TSA=TSC 101 1
  214.  dc.b 0,0,0,0,$eb,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0                    ;SWA=XBA 102 1
  215.  
  216. ;---------------------------------------------------------------------------------
  217. ;Bit's n' Byte's
  218. ;---------------------------------------------------------------------------------
  219.  
  220. * Assembler Flags *
  221.  
  222. SafeMode:    dc.w    0            ;enable savemode
  223. SendMode:    dc.w    0            ;enable sendmode
  224. AskHash:    dc.w    0            ;# of hash
  225. ExpertMode:    dc.w    0            ;no warnings
  226. StatsMode:    dc.w    0            ;gimme gimmicks
  227. HelpMode:    dc.w    0            ;dump help page
  228. NoReqMode:    dc.w    0            ;dont display req's!
  229. OldWindowPTR:    dc.l    0            ;old window ptr
  230. OldPri:        dc.l    0            ;task old pri!
  231. SourceBase:    dc.l    0            ;souce base
  232. SourceSize:    dc.l    0
  233. AsmMaxErrors:    dc.l    1            ;errors max!
  234. MagicomHeader:    dc.w    0            ;<>0 header enabled!
  235.  
  236. * System *
  237.  
  238. ExecBase:    dc.l    0            ;copy form $4
  239. DosBase:    dc.l    0            ;lib base pointers
  240. IntBase:    dc.l    0
  241. IntName:    dc.b    "intuition.library",0
  242. DosName:    dc.b    "dos.library",0
  243. OutHandle:    dc.l    0            ;output handle
  244. CmdLine:    dc.l    0,0,0,0,0,0,0,0,0,0,0,0    ;options
  245. RDArgs:        dc.l    0
  246. SourceHandle:    dc.l    0            ;source file handle
  247. DestinHandle:    dc.l    0            ;buffer handle
  248.  
  249. * FileNames *
  250.  
  251. FileName:    dc.b    0            ;sourcefilename
  252.         ds.b    127,0
  253. ExeString:    dc.b    "smc13 "        ;just easy!
  254. OutputName:    dc.b    0            ;sourcefilename
  255.         ds.b    127+5,0            ;+ext.
  256. ListName:    dc.b    0
  257.         ds.b    127,0            ;reseve bytes
  258. SMC_Header:    ds.b    512,0            ;thats a header for the SMC :)
  259.  
  260. ;---------------------------------------------------------------------------------
  261. * MSG's *
  262. ;---------------------------------------------------------------------------------
  263.  
  264. nokick2:    dc.b    "Sorry, the WD65C816 Assembler requiers Kick 37.175 or greater...",10
  265.         dc.b    "Contact your local Commodore Dealer and order an upgrade kit.",10,0
  266. nokick2e:    
  267. welcome:    dc.b    $9b,"1;32;40m","WD65C816 S-NES Macro Assembler",$9b,"0;31;40m"
  268.         dc.b    " v1.0 [MC68030] © 1992/3 by Infernal Byte, INC.",10
  269.         dc.b    "written by Florian W. Sauer & Stefan M. Schulze - 24/11/1992",10,0
  270. Template:    dc.b    10,"FILE/A,LIST/K,NOWARN/S,STAT/S,HELP/S,NOREQ/S,MAXERR/K/N,ASK/K,SAFE/S,SEND/S",0
  271. DosErrHeader:    dc.b    10,$9b,"0;32;40m","65C816 (DosError) ",$9b,"0;31;40m",0
  272. ErrHeader:    dc.b    10,$9b,"0;32;40m","65C816 (Assembly/%ld) ",$9b,"0;31;40m",": ",0
  273. ErrHeader2:    dc.b    10,$9b,"0;32;40m","65C816 (Resolve/%ld) ",$9b,"0;31;40m",": ",0
  274. WarnHeader:    dc.b    10,$9b,"0;32;40m","65C816 (Warning/%ld) ",$9b,"0;31;40m",": ",0
  275. reading:    dc.b    10,"[reading]",0
  276. assembling:    dc.b    "[assembling]",0
  277. assembling2:    dc.b    "[assembling[w/safe-checking]]",0
  278. warnings:    dc.b    "[",$9b,"0;36;40mwarnings!",$9b,"0;31;40m]",0
  279. writing:    dc.b    "[writing]",0
  280. sending:    dc.b    "[sending]",10,10,0
  281. done:        dc.b    "[done]",10,0
  282. errorsfound:    dc.b    10,"%ld errors in first %ld lines, hence: ",$9b,"0;32;40m","Neither object written nor sended."
  283.         dc.b    $9b,"0;31;40m",10,0
  284. help:        dc.b    $9b,"0;32;40m"
  285.         dc.b    10,"HELP PAGE ",$9b,"0;31;40m","for ",$9b,"1;32;40m"
  286.         dc.b    "WD65C816 S-NES Macro Assembler",$9b,"0;31;40m",":",10,10
  287.  
  288.         dc.b    "This one-pass assembler is designed to create really cool games running",10
  289.         dc.b    "on the S-NES system using the SuperMagicom or similar hardware. A lot",10
  290.         dc.b    "of commands have been installed to make live much easier. ",$9b,"0;32;40mNote:",$9b,"0;31;40m This is a",10
  291.         dc.b    "cool piece of software, its for cool dudes only, supporting includes,",10
  292.         dc.b    "macros, conditional assembly, c-like defines and much more. Also it uses",10
  293.         dc.b    "latest software technologies for top speed analyzing & creating code (yep,",10
  294.         dc.b    "up to ",$9b,"0;32;40msix times faster",$9b,"0;31;40m than FAsm v0.52 using 300000 lines of rts.) so",10
  295.         dc.b    "don't be a pinhead and send us your registeration in. (If you're mainly",10
  296.         dc.b    "coding demos you're allowed to use it freely, anyway we're interested in",10
  297.         dc.b    "your sourcecodes for the SNES.)",10,10
  298.  
  299.         dc.b    $9b,"0;32;40m","Quick Overview of commandline-options:",$9b,"0;31;40m",10
  300.         dc.b               "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",10
  301.         dc.b    $9b,"0;32;40m","FILE/A",$9b,"0;31;40m       - Name of file to assembly. Suggested postfix '.s'.",10
  302.         dc.b    $9b,"0;32;40m","LIST/K",$9b,"0;31;40m       - Name of listing outputfile. No Name <=> No Output Listing.",10
  303.         dc.b    $9b,"0;32;40m","NOWARN/S",$9b,"0;31;40m   - Switch. Disables warnings during assembly.",10
  304.         dc.b    $9b,"0;32;40m","STAT/S",$9b,"0;31;40m       - Switch. Enables statistic de-briefing after assembly.",10
  305.         dc.b    $9b,"0;32;40m","HELP/S",$9b,"0;31;40m       - Give some quick&dirty information about this cool package.",10
  306.         dc.b    $9b,"0;32;40m","NOREQ/S",$9b,"0;31;40m       - Switch. Disables most requesters during assembly.",10
  307.         dc.b    $9b,"0;32;40m","MAXERR/K/N",$9b,"0;31;40m - Sets the number of errors before assembly will be aborted.",10
  308.         dc.b    $9b,"0;32;40m","ASK/K",$9b,"0;31;40m       - Gives info about an WD65C816 instruction, e.g.: ask=lda.",10
  309.         dc.b    $9b,"0;32;40m","SAFE/S",$9b,"0;31;40m       - Switch. Enables hash (syntax) checking. Slowdowns slightly.",10
  310.         dc.b    $9b,"0;32;40m","SEND/S",$9b,"0;31;40m       - Switch. After saving image send it directly to the SMC.",10
  311.  
  312.         dc.b    10,"At least FILE/A must be specified, the rest is totally optional. Dudes",10
  313.         dc.b    "should try the LIST/K keyword, since lame coders may use the clockcycle and",10
  314.         dc.b    "byte length information(s) stored in the assembly listing. ASK/K is also",10
  315.         dc.b    "able to printout a complete list of supported mnemonics, just try something",10
  316.         dc.b    "like sasm ask=all.",10,0
  317.  
  318. * ERROR TABLE (also contains WARNINGS) *
  319.  
  320. errs:        dc.b    "Not enough MEMORY for sourcecode. Do not spent",10
  321.         dc.b    "all your money for SNES-ROM Modules. Buy more RAM !",10,0
  322.         dc.b    "Filename TOO LONG. Suggest an assignment would",10
  323.         dc.b    "help in such situation.",10,0
  324.         dc.b    "Running out of MEMORY during assembly. Check your",10
  325.         dc.b    "HEAP keyword and/or free some resources.",10,0
  326.         dc.b    "Hey dude, i'am just MISSING a HEAP instruction.",10
  327.         dc.b    "I guess you really should take a look at the doxs.",10,0
  328.         dc.b    "Assembly stopped during *TOO* *MUCH* *ERRORS*...",10
  329.         dc.b    "Pretty uncøøl, dude.",10,0
  330.         dc.b    "Ouch! The SYNTAX of this line is CRYPTIC or a pseudo",10
  331.         dc.b    "opcode did not work. Refer to any WD65C816 assembly manual or the doxs.",10,0
  332.         dc.b    "USER ABORT! I suppose you don't know what you are",10
  333.         dc.b    "doing here. Anyway, I stopped.",10,0
  334.         dc.b    "NO OUTPUT!, since sourcefile seems to be EMPTY.",10
  335.         dc.b    "I hope your volume hasn't any serious damage!",10,0
  336.         dc.b    "Obsolente EOF found in middle of sourceline.",10,0
  337.         dc.b    "INTERNAL ERROR: Dont know how to verify this",10
  338.         dc.b    "addressing-mode. Please REPORT this.",10,0
  339.         dc.b    "The OPERAND of this line is BAD, may be there",10
  340.         dc.b    "is a semicolon missing ?",10,0
  341.         dc.b    "Implied value expects 8-bit. Not more! Truncated.",10,0
  342.         dc.b    "Direct Indirect expects 8-bit only. Truncated.",10,0
  343.         dc.b    "Just expected an absolute 16-bit OPERAND. Sorry,",10
  344.         dc.b    "this one has WRONG SIZE...",10,0
  345.         dc.b    "Just expected an absolute 24-bit OPERAND. Sorry,",10
  346.         dc.b    "this one has WRONG SIZE...",10,0
  347.         dc.b    "Absolute addressing expects max. 24-bit. Truncated.",10,0
  348.         dc.b    "Block Move expects 8-bits only. Truncated.",10,0
  349.         dc.b    "Illegal WD65C816 MNEMONIC. Thats really wretched",10
  350.         dc.b    "input! Try: sasm ask=all for a complete list.",10,0
  351.         dc.b    "HEAP command has bad syntax. Try sasm help for a hint",10
  352.         dc.b    "to do it right...",10,0
  353.         dc.b    "FATAL ERROR! Failed to allocate %ld bytes of",10
  354.         dc.b    "memory during HEAP command. Assembling with no hope.",10,0
  355.         dc.b    "ORG command has bad syntax. Try ORG $8000 or *=$8000.",10
  356.         dc.b    "Thats the way I like it.",10,0
  357.         dc.b    "SIZE doesnt specify the same objectsize as HEAP does.",10,0
  358.         dc.b    "SIZE command in front of HEAP found. SIZE ignored.",10,0
  359.         dc.b    "SIZE command has bad syntax. SIZE ignored.",10,0
  360.         dc.b    "Just found a SECOND HROM or LROM instruction. Can not",10
  361.         dc.b    "cancel the first setting.",10,0
  362.         dc.b    "Found a LROM or HROM with bad syntax. Suggest theres",10
  363.         dc.b    "a semicolon missing in action.",10,0
  364.         dc.b    "The OBJECT-CODE BUFFER is FULL. Suggest the HEAP ins-",10
  365.         dc.b    "truction is bad or just missing. Size wont help!",10,0
  366.         dc.b    "The SMC+ command has not a valid end_of_line. Maybe",10
  367.         dc.b    "just a semicolon missing?",10,0
  368.         dc.b    "You just asked me to do MORE than one HEAP instruction.",10
  369.         dc.b    "Sorry, can't do that. Aborted. Core dumped.",10,0
  370.         dc.b    "Sorry, your SAY command has bad syntax or there is",10
  371.         dc.b    "nothing to printout !",10,0
  372.         dc.b    "Uuups! The WD65C816 has a 24-bit PC only. Since, I",10
  373.         dc.b    "can not decide what you want, I aborted.",10,0
  374.         dc.b    "Uuups! Cant set the PC BACK in code, since we are",10
  375.         dc.b    "creating image files...",10,0
  376.         dc.b    "Uupps! Cant set the PC into lower 32k of any bank,",10
  377.         dc.b    "when we are in LROM mode. Sorry.",10,0
  378.         dc.b    "Implied value expects 16-bit. Not more! Truncated.",10,0
  379.         dc.b    "This is not a valid WD65C816 ADDRESSING-MODE. Suggest",10
  380.         dc.b    "there are just some sluggy, evil typingerrors...",10,0
  381.         dc.b    "Ouch! The syntax of the DC command is bad. Just",10
  382.         dc.b    "kidding? Check for a valid seperators!",10,0
  383.         dc.b    "Ouch! The syntax of the .PAD command is bad. There is",10
  384.         dc.b    "just a semicolon missing!",10,0
  385.         dc.b    "Ouch! The syntax of the .BIN command is bad. Just try",10
  386.         dc.b    "something like: .bin dh0:demos/logo.dat ! Should work!",10,0
  387.         dc.b    "Sorry! CAN NOT FIND the FILE. Maybe a device is not",10
  388.         dc.b    "mounted ? Or some typing errors!",10,0
  389.         dc.b    "Ouch! Line bad! Just type .ask! Nothing more, that",10
  390.         dc.b    "will help.",10,0
  391.         dc.b    "Jackson! There is a BRANCH instruction with OFFSET NULL.",10,0
  392.         dc.b    "Sorry! Byte displacement OUT OF RANGE by %ld byte(s).",10
  393.         dc.b    "Suggest your code needs some cure to work...",10,0
  394.         dc.b    "ORG or *= sets PC to actual PC, so this line is stupid.",10,0
  395.         dc.b    "Can not append a SMC header, if inital PC is not $8000.",10
  396.         dc.b    "Please remove inital PC setting with ORG or *=...",10,0
  397.         dc.b    "There is a long BRANCH instruction with OFFSET NULL.",10,0
  398.         dc.b    "This OPCODE does NOT SUPPORT this ADDRESSING-MODE.",10
  399.         dc.b    "Maybe you just selected the wrong index-register?",10,0
  400.         dc.b    "Upps! LABEL has BAD CHARACTER in it, cant use it.",10
  401.         dc.b    "Valid are only A-Z, a-z, 0-9 and _, nothing more!",10,0
  402.         dc.b    "LABEL defined TWICE. Sorry, can not accept that...",10
  403.         dc.b    "Note: This assembler is case sensitive.",10,0
  404.         dc.b    "UNKNOWN SYMBOL FOUND. Remember: Some commands, like",10
  405.         dc.b    "ds, heap, rs=, ORG, *= dont accept forward references. See doxs!",10,0
  406.         dc.b    "Dude! Its forbidden to define labels in lines which",10
  407.         dc.b    "contain ORG or *= commands. Better read the doxs..",10,0
  408.         dc.b    "This EQU command has (sorry) BAD SYNTAX. A line which",10
  409.         dc.b    "I would accept is like: Null = 0. Thats it!",10,0
  410.         dc.b    "Uups! Theres no label to store the equ-information in.",10
  411.         dc.b    "Remember: SYMBOL: is only valid for PC labels.",10,0
  412.         dc.b    "Ouch! Can not find a valid string end seperator. Just",10
  413.         dc.b    "type strings like, ",34,"HBT sucks :)",34,"...",10,0
  414.         dc.b    "Ouch! The SYNTAX of a RS-COMMAND is BAD. You want to",10
  415.         dc.b    "use structures, but dont know how to define? DoXs!",10,0
  416.         dc.b    "Uups! Theres no label to store the rs-information in.",10
  417.         dc.b    "Only SYMBOL rs.w 0 is allowed! No SYMBOL= nor SYMBOL: !",10,0
  418.         dc.b    "Attention! This rs-cmd does NOT increment the rs-value.",10,0
  419.         dc.b    "Uups! The Syntax of the DS command is BAD. If you had",10
  420.         dc.b    "read the doxs yould know: ds[r].x amount,data is the only one...",10,0
  421.         dc.b    "Attention! DS creates NULL entries. Totally usless...",10,0
  422.         dc.b    "Uups! This string is limited to 32-bit (four chars) only.",10
  423.         dc.b    "Suggest your code need some cure to work just fine..",10,0
  424.         dc.b    "There is NO SMC-HEADER, therefore I cant send the file...",10,0
  425.         dc.b    "Ouch! Just an INVALID EXPRESSION found. Valid terminals",10
  426.         dc.b    "are: ||,&&,+,-,*,/,^,<<,>>,( and ) [in precedence order].",10,0
  427.         dc.b    "INTERNAL ERROR: Unknown Operator in Apply(); found, please",10
  428.         dc.b    "report this to the programmers. Thanks!",10,0
  429.         dc.b    "Upps! You want me to divide through zero! Thats no good,",10
  430.         dc.b    "therefore i stopped before Motorola will do!",10,0
  431.         dc.b    "I cant calculate the expression. Just look at the docs",10
  432.         dc.b    "or write a bugreport and send it in...",10,0
  433.         dc.b    "Ouch! LABEL TOO SHORT! Any label or symbol must have",10
  434.         dc.b    "a length of two or more chars... (yep, unlimited !!)...",10,0
  435.         dc.b    "This SET command has (sorry) BAD SYNTAX. A line which",10
  436.         dc.b    "I would accept is like: Null SET Null+1. Thats it!",10,0
  437.         dc.b    "Uups! Theres no label to store the set-information in.",10
  438.         dc.b    "Remember: SYMBOL: is only valid for PC labels.",10,0
  439.         dc.b    "Gimmick! Can not handle this SET command, since the symbol",10
  440.         dc.b    "is defined as NON-SET-COMPATIBLE in the symboltable.",10,0
  441.         dc.b    "Mompls! CAN NOT ACCESS SYMOBOLTABLE, since it is not",10
  442.         dc.b    "exsistant at the moment, preform a HEAP first.",10,0
  443.         dc.b    "FATAL ERROR! Failed to allocate %ld bytes of",10
  444.         dc.b    "memory for forward references. Assembling with no hope.",10,0
  445.         dc.b    "Thats to un-handy, cant evaluate DOUBLE FORWARD references.",10
  446.         dc.b    "Or just theres a truly UNDEFINED SYMBOL. Cure it!",10,0
  447.         dc.b    "INTERNAL ERROR: Symbol-table corrupt during resolve,",10
  448.         dc.b    "please report this to the programmers. Thanks!",10,0
  449.